import time


def deco(fun):
    def wrapper(*args, **kwargs):
        start_time = time.time()
        fun(*args, **kwargs)
        end_time = time.time()
        msecs = (end_time - start_time) * 1000
        print(f"函数运行时间为: {msecs} ms")

    return wrapper


@deco
def func(a, b):
    print("result is %d" % (a + b))
    time.sleep(1)


if __name__ == '__main__':
    func(3, 4)
